<?php
/**
 * Created by 长毋相忘c.
 * 文件用途描述 :
 * Date: 2018/2/18/018
 * Time: 12:05
 */

namespace app\api\model;


class User extends BaseModel
{

    public function address(){
        return$this->hasOne('UserAddress','user_id','id');
    }


    public static function getByOpenid($openid){
        $user=self::where('openid','=',$openid)
            ->find();
        return $user;
    }


}